home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Programming
/
Amos
/
AMOSList-0198
/
AMOSLIST
/
000171_amos-request@svcs1.digex.net_Sat Jan 31 19:14:52 1998.msg
< prev
next >
Wrap
Text File
|
1998-06-24
|
13KB
|
367 lines
>From amos-request@svcs1.digex.net Sat Jan 31 19:14:52 1998
Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by pony-1.mail.digex.net (8.8.8/8.8.8) with ESMTP id TAA07534
for <mcox@access.digex.net>; Sat, 31 Jan 1998 19:14:52 -0500 (EST)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.5/8.8.5) id RAA19609
for amos-out; Sat, 31 Jan 1998 17:07:35 -0500 (EST)
Received: from pony-1.mail.digex.net (pony-1.mail.digex.net [204.91.241.5])
by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id RAA19606
for <amos-list@svcs1.digex.net>; Sat, 31 Jan 1998 17:07:34 -0500 (EST)
Received: from mail2.desupernet.net (mail.desupernet.net [204.249.184.82])
by pony-1.mail.digex.net (8.8.8/8.8.8) with SMTP id RAA22043
for <amos-list@access.digex.net>; Sat, 31 Jan 1998 17:07:32 -0500 (EST)
Received: (qmail 7515 invoked from network); 31 Jan 1998 22:07:03 -0000
Received: from unknown (HELO redrose.net) (mushy-pd@208.7.253.140)
by 204.249.184.82 with SMTP; 31 Jan 1998 22:07:03 -0000
From: Mush <mushypd@redrose.net>
Reply-To: mushypd@redrose.net
To: Martin =?iso-8859-1?Q?M=F8ller?= <flop@get2net.dk>
CC: amos-list@access.digex.net
Date: Sat, 31 Jan 1998 17:09:30 +0500
Message-ID: <yam7335.1541.4181016@mail.redrose.net>
In-Reply-To: <yam7335.792.120605496@bohr.get2net.dk>
X-Mailer: YAM 1.3.5 [020] - Amiga Mailer by Marcel Beck
Organization: Mushroom PD - AMOS Public Domain Library
Subject: Re: Arexx calls from amos
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by svcs1.digex.net id RAA19607
Status: O
X-Status:
It was on the night of 31-Jan-98, when no creatures were stirring, and all was
silent. Suddenly, Martin jumped out from behind a rock and wouldnt stop
shouting about "Arexx calls from amos" until I was forced to knock them out:
�-> Hi guys.
�-> Can anyone of you tell me if there exists a arexx extension for amos.
Not that I know of, one isnt needed =)
�-> I would like to be able to send a command directly to yam.
�-> Something like this would be nice:
�-> Arexx address="YAM"
�-> Arexx send "getmail"
�-> Does this extension exists?, and where to get it?
�-> I know i'm able to use the exec command like exec "RX Script.arexx".
�-> But that's another problem i'm having, it's not stable enough.
�-> Some times the script works perfectly, other times it just executes
�-> the first three or four lines. and then hangs. Have anyone else had this
�-> problem, and how do i avoid it?.
OK, take a look at this program that allows AMOS to interact with AmIRC. At
the bottom is also the small AREXX script, mish.amirx, which goes in AmIRC and
all channel text is sent to it:
Rem ********************************************************************
Rem ** NIALL Non-Intelligent AMOS Language Learner Version 1.0 � **
Rem ** ========================================================== **
Rem ** Written By Matthew Peck in 1990 **
Rem ********************************************************************
Set Buffer 400
MNW=3000
Randomize Timer
Hide On : Close Editor
Close Workbench
Dim WORD$(MNW,1),W$(255),CO(1)
Global COM,T$,WORD$(),NUM,W$(),W,SPEAK,HARD,CO(),MNW
WORD$(0,0)=" " : WORD$(MNW,0)="."
SETUP
Do
USER_INPUT
If COM=1 Then Goto SKIPIT
NIALL_REPLIES
SKIPIT:
Loop
Rem --------------------------------------------------------------------
Procedure SEE_INSTRUCTIONS
Screen Hide 1 : Screen Hide 0
For F=1 To 2 : Unpack 2 To 2 : Gr Writing 0
For G=1 To 25 : Read C,A$ : Ink 0 : Text 17,33+G*8,A$
Ink C : Text 16,32+G*8,A$
Next G : Wait Key : Fade 2 : Wait 30 : Next F
Screen Close 2
Screen Show 1 : Screen Show 0
Data 6," COMMAND WORDS"
Data 1," "
Data 1," When you are given the prompt USER: you will normally type in a
sentence,"
Data 1,"but you can also type in a command word. All command words are
prefixed"
Data 1,"by a '#'. This version (1.0) can support the following commands."
Data 1," "
Data 7,"#LIST Displays Nialls current dictionary on the screen."
Data 1," "
Data 7,"#LLIST Outputs the dictionary to a printer."
Data 1," "
Data 7,"#LPRINT Toggles direct output to printer."
Data 1," "
Data 7,"#SPEAK Toggles speech."
Data 1," "
Data 7,"#SAVE Saves the current dictionary to disc under any name."
Data 1," "
Data 7,"#LOAD Loads a previously saved dictionary from disc."
Data 1," "
Data 7,"#CORRECT Corrects a mispelt word in the dictionary."
Data 1," "
Data 7,"#FRESH Clears the current dictionary."
Data 1," "
Data 7,"#QUIT Leaves the program."
Data 1," "
Data 5," PRESS A KEY"
Data 5," CREDITS"
Data 1," "
Data 4," Written by Matthew Peck in AMOS Version 1.1 in August
1990"
Data 1," The original idea for NIALL was adapted from a program called
DANI, which"
Data 1,"was written for the MSX machines and published in a magazine,MSX
Computing."
Data 1,"NIALL is a complete re-write but I would like to give credit to the
author"
Data 1,"of DANI for the inspiration. However, I no longer have the
magazine and do"
Data 1,"not know the author's name. If you wrote DANI then contact me so
that I can"
Data 1,"place your name in the credit list."
Data 1," "
Data 1," Many thanks go to the following people for their help,
suggestions etc."
Data 6,"Adam Wright................................For waiting for me to
code this."
Data 6,"Pat Fox and Julian Brown.....For playtesting my BBC basic version
to death."
Data 6,"Kevin Tye...................................For being a generally
nice guy."
Data 6,"Gary Keogh...............For being a great room-mate and friend at
college."
Data 6,"Francios Lionet........................For AMOS, what else, and
finally to "
Data 6,"Sarah Gould...........For being such a caring and understanding
girlfriend."
Data 1," "
Data 1,"My address is:"
Data 4," 23 Welbeck Avenue, Bedgrove, Aylesbury, Bucks, ENGLAND, HP21
9BH."
Data 1," Contact me with/for ideas, programs, NIALL dictionaries and NIALL
updates."
Data 1," "
Data 5," PRESS A KEY"
Data 1," "
Data 5," AMOS (c) 1990 Mandarin/Jawx"
End Proc
Procedure USER_INPUT
COM=0 : For F=1 To 3 : Print : Next F : For F=1 To 3 : Cup : Next F
Pen CO(1) : Print "USER:"; : Pen 1 : Line Input " ";T$
Cup : Pen CO(1) : Print "USER: "; : Pen 1 : Print T$
If HARD=1 Then Lprint " USER:";T$
If T$="" Then Pop Proc
T$=Lower$(T$)
Rem --- Is it a command string ---
If Left$(T$,1)="#" Then COMMANDS : COM=1 : Pop Proc
Rem --- Cuts out the rubbish ---
R$="" : For F=1 To Len(T$)
If Mid$(T$,F,1)="," Then Mid$(T$,F,1)="."
If Instr("!�$%^&*()_+|}{@?></#\="+Chr$(34),Mid$(T$,F,1))=0 Then
R$=R$+Mid$(T$,F,1)
Next F : T$=R$
Rem --- Seperates into words ---
If Right$(T$,1)="." Then Right$(T$,1)=" "
Q$=T$
FULLSTOP:
If Instr(Q$,".")<>0 Then FS=1 : T$=Left$(Q$,Instr(Q$,".")-1) :
Q$=Right$(Q$,Len(Q$)-Instr(Q$,"."))
W=1 : W$(W)="" : For F=1 To Len(T$)
If Mid$(T$,F,1)=" " Then If Mid$(T$,F+1,1)<>" " Then W=W+1 : W$(W)="" :
Goto SKIP
W$(W)=W$(W)+Mid$(T$,F,1)
SKIP: Next F
If NUM<>MNW-1
ANALYSE_SENTENCE
End If
If FS=1 Then FS=0 : T$=Q$ : Goto FULLSTOP
End Proc
Procedure ANALYSE_SENTENCE
Rem --- Loop for the number of words +1 ---
OLD=0
For H=1 To W+1
If H=W+1 Then F=MNW : Goto FOUNDIT
For F=1 To NUM : If W$(H)=WORD$(F,0) Then Goto FOUNDIT
Next F
Rem --- The word is a new one ---
NUM=NUM+1 : WORD$(NUM,0)=W$(H) : F=NUM
FOUNDIT:
If WORD$(OLD,1)="" Then WORD$(OLD,1)="1|"+Str$(F)+"(1)" : Goto ALLDONE
C$=WORD$(OLD,1) : C$=Str$(Val(C$)+1)+Right$(C$,Len(C$)-Instr(C$,"|")+1)
For G=Instr(C$,"|")+1 To Len(C$)
If Val(Right$(C$,Len(C$)-G))=F Then Goto HERE
G=Instr(C$,")",G)
Next G
C$=C$+Str$(F)+"(1)" : WORD$(OLD,1)=C$ : Goto ALLDONE
HERE:
G=Instr(C$,"(",G) : I=Instr(C$,")",G)-1
C$=Left$(C$,G)+Str$(Val(Right$(C$,Len(C$)-G))+1)+Right$(C$,Len(C$)-I)
WORD$(OLD,1)=C$
ALLDONE:
OLD=F
Next H
End Proc
Procedure NIALL_REPLIES
If NUM=0 Then Pen CO(1) : Print "I cannot speak yet!" : Pen 1 : Pop Proc
REP$="" : C=0
RLOOP:
C$=WORD$(C,1) : R=Rnd(Val(C$)) : If R=0 Then Goto RLOOP
For G=Instr(C$,"(") To Len(C$)
R=R-Val(Right$(C$,Len(C$)-G)) : If R<=0 Then Goto THISWORD
G=Instr(C$,"(",G+1)-1
Next G
End
THISWORD:
For F=G To 1 Step -1
F$=Mid$(C$,F,1) : If(F$=")") or(F$="|") Then Goto WORD
Next F
WORD:
D=Val(Right$(C$,Len(C$)-F))
REP$=REP$+WORD$(C,0)+" "
C=D : If C<>MNW Then Goto RLOOP
Do
If Left$(REP$,1)<>" " Then Exit
REP$=Right$(REP$,Len(REP$)-1)
Loop
If REP$="" Then Pop Proc
Left$(REP$,1)=Chr$(Asc(Left$(REP$,1))-32)
Right$(REP$,1)="."
Pen CO(1) : Print "NIALL:"; : Pen 1 : Print REP$
If SPEAK=1 Then Say REP$,0
If HARD=1 Then Lprint "NIALL:";REP$
End Proc
Procedure SETUP
If Fast Free<>0
Unpack 1 To 0 : Screen Display 0,128,40,320,28
End If
If Fast Free<>0
Screen Open 1,640,230,4,Hires : CO(0)=2 : CO(1)=3
Else
Screen Open 1,320,230,2,Lowres : CO(0)=1 : CO(1)=1
End If
Screen Display 1,128,70,, : Flash Off : Screen 1 : Palette $0,$FFF,$F00,$48
Pen CO(0) : Paper 0 : Cls
Centre "Welcome to NIALL" : Print
Centre "Non Intelligent AMOS Language Learner" : Print
Centre "Written in AMOS Basic Version 1.1" : Print
Centre "by Matthew Peck in 1990" : Print : Print
Centre "This program is fully Public Domain" : Print : Print
If Fast Free<>0
Centre "Would you like further instructions (Y/N)" : A$=Input$(1) :
Print
A$=Upper$(A$)
If A$="Y"
SEE_INSTRUCTIONS
End If
Centre ".......... Get Typing ..........."
End If
Print
End Proc
Procedure COMMANDS
If T$="#list"
For F=0 To NUM Step 20
For G=0 To 19 : If F+G<=NUM
Print F+G,WORD$(F+G,0),WORD$(F+G,1)
End If
Next G : Print : Pen CO(0) : Centre "PRESS A KEY" : Pen 1 : Print :
Wait Key
Next F : Pop Proc
End If
If T$="#llist"
For F=0 To NUM : Lprint F,WORD$(F,0),WORD$(F,1) : Next F
End If
If T$="#save"
Show On : A$=Fsel$("*.NIALL") : Hide On
If Upper$(Right$(A$,6))<>".NIALL"
A$=A$+".NIALL"
End If
Open Out 1,A$ : Print #1,NUM
For F=0 To NUM : Print #1,WORD$(F,0) : Print #1,WORD$(F,1) : Next F
Close 1
End If
If T$="#load"
Show On : A$=Fsel$("*.NIALL") : Hide On : Open In 1,A$
Input #1,NUM
Y=Y Curs
For F=0 To NUM : Locate 0,Y : Print "Countdown:";NUM-F;" "; : Input
#1,WORD$(F,0) : Input #1,WORD$(F,1) : Next F
Close 1
Print
End If
If T$="#correct"
Pen CO(0) : Print "Enter incorrect word:"; : Pen 1 : Input " ";O$
For F=1 To NUM
If Lower$(O$)=WORD$(F,0)
Pen CO(0) : Print "Enter correct spelling:"; : Pen 1 : Input "
";N$
WORD$(F,0)=Lower$(N$)
Else
Next F : Print "Cannot find word ";O$
End If
End If
If T$="#fresh"
Pen CO(0) : Centre "Are you sure (Y/N)" : A$=Input$(1) : Print
If Upper$(A$)="Y"
For F=0 To NUM : WORD$(F,0)="" : WORD$(F,1)="" : Next F : NUM=0
End If
End If
If T$="#quit"
Pen CO(0) : Centre "Do you really want to quit (Y/N)" : A$=Input$(1) :
Print
If Upper$(A$)="Y"
Screen Close 0 : Screen Close 1 : End
End If
End If
If T$="#speak"
If SPEAK=0
SPEAK=1
Else
SPEAK=0
End If
End If
If T$="#lprint"
If HARD=0
HARD=1
Else
HARD=0
End If
End If
End Proc
And now for the AREXX script (mish.amirx):
/**************************************************************************/
/* Script to parse stuff from AmIRC to AMOS */
/**************************************************************************/
parse arg args
options results
address AMOS args
EXIT 10
--
Andrew "Mushroom" Kellett
--
Email: Andy Kellett <mushypd@redrose.net> Team *AMOS* + IAPA Team *AMIGA*
alt.religion.amos - AMOS now on usenet! AMOS Mailinglist also mirrored
World's Largest AMOS Homepages - http://www.mushy-pd.demon.co.uk
Official F1 Software Distributor for the USA
Massive FTP site with AMOS/C64 and Mods/Samples + more at
mushy-pd.dyn.ml.org